import { request } from "@/utils/http";
import { HospitalRequest, ReqHospitalSetListRequest, addHospital, putHospital } from "./model/HospitalSetType";

// 初始化数据
export function getHospital({ page, limit, hoscode, hosname }: HospitalRequest) {
    return request.get<any, ReqHospitalSetListRequest>(`/admin/hosp/hospitalSet/${page}/${limit}`,{
        params:{
            hoscode,
            hosname
        }
    })
}

// 添加数据
export function addHospitalSet(hospitalSet:addHospital){
    return request.post("/admin/hosp/hospitalSet/save",hospitalSet)
}
// 根据ID获取数据
export function getHospitalID(id:string){
    return request.get<any,ReqHospitalSetListRequest>(`/admin/hosp/hospitalSet/get/${id}`)

}
// 根据ID修改数据
export function updateHospitalID(hospitalSet:putHospital){
    return request.put<any,null>("/admin/hosp/hospitalSet/update",hospitalSet)
}
// 根据ID删除
export function delHospital(id:string){
    return request.delete<any,null>(`/admin/hosp/hospitalSet/remove/${id}`)

}
// 根据ID批量删除数据
export function delHospitalAll(idList:React.Key[]){
    return request.delete<any,null>("/admin/hosp/hospitalSet/batchRemove",{
        data:idList
    })

}
